#pragma once
#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;

//1、一元谓词
	struct GreatFive
	{
		bool operator()(int val)
		{
			return val > 5;
		}
	};

	void test01()
	{
		vector<int> v;
		for (int i = 0;i < 10;i++)
		{
			v.push_back(i);
		}

		auto it = find_if(v.begin(), v.end(), GreatFive());   //find_if函数会自动将遍历的元素当作参数传入到GreatFive()
		if (it == v.end())
		{
			cout << "没找到！" << endl;
		}
		else cout << "找到：" << *it << endl;
	}

int main()
{
	test01();
	system("pause");
	return 0;

}